package com.adee.java.json;

import lombok.Data;
import lombok.ToString;

import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicLong;

@Data
@ToString
public class User {
    private String name;
    private short age;
    private boolean sex;
    private AtomicLong steps;
    private Map<String, Object> attrs;
    private Set<String> tags;
    private List<Object> places;

    public User(boolean init) {
        if(init) {
            name = "zhangsan";
            age = 30;
            sex = true;
            steps = new AtomicLong(10);
            attrs = new ConcurrentHashMap<>();
            attrs.put("height", 172);
            attrs.put("weight", 66);
            tags = new LinkedHashSet<>();
            tags.add("宅男");
            tags.add("技术控");
            places = new CopyOnWriteArrayList<>();
            places.add("廊坊");
            places.add("北京");
            places.add("廊坊");
        }
    }

    public User() {

    }
}
